#pragma once
#include "../Utils/PlatTypeUtil.h"

class Timer
{
public:
	Timer();

	float GetTotalTime() const; // in seconds
	float GetDeltaTime() const; // in seconds
	uint32 GetFps() const;
	float GetMspf() const;

	void Reset(); // Call before message loop.
	void Start(); // Call when unpaused.
	void Stop();  // Call when paused.
	void Tick();  // Call every frame.

private:
	double mSecondsPerCount;
	double mDeltaTime;

	int64 mBaseTime;
	int64 mPausedTime;
	int64 mStopTime;
	int64 mPrevTime;
	int64 mCurrTime;

	bool mStopped;

	float mTimeElapsed;
	uint32 mFrameCount;
	uint32 mFps;
	float mMspf;
};